<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3、找出一个整数数组中第 K 大的整数 </title>
</head>

<body>
  <script>

    var kthLargestNumber = function (nums, k) {
      // 转成数字类型
      const arr = nums.map(Number)
      //进行排序
      arr.sort((a, b) => {
        if (a <= b) {
          return 1
        }
        return -1
      })
      return String(arr[k - 1])
    };
    console.log(kthLargestNumber(["3", "6", "7", "10"], 4))
  </script>
</body>

</html>